Skip to content

Fixed "ValueError" in epsilon_schedule() when computing 0 sinkhorn distance.#77

Open
shallowcosmicjumper wants to merge 1 commit into
jeanfeydy:mainfrom
shallowcosmicjumper:main
Open

Fixed "ValueError" in epsilon_schedule() when computing 0 sinkhorn distance.#77
shallowcosmicjumper wants to merge 1 commit into
jeanfeydy:mainfrom
shallowcosmicjumper:main

Conversation

@shallowcosmicjumper

@shallowcosmicjumper shallowcosmicjumper commented Dec 30, 2023

Copy link
Copy Markdown

fixed #34, #51, #74.

Cause

The roughly estimated maximum diameter is 0. By default, diameter of geomloss.SamplesLoss is None, an upper bound of the distance will be roughly estimated and used for generating the epsilon list. When the inputs are too close or the same, the estimated maximum diameter could be 0. Then p * np.log(diameter)* raises ValueError: Maximum allowed size exceeded for np.log(0) is -inf.

Solution

Set the argument blur as a lower bound for diameter. This still provides a valid eps_list for the further process.

Results

Using the case in #51
image

… Maximum allowed size exceeded" in epsilon_schedule() caused by np.log(0).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValueError: Maximum allowed size exceeded

1 participant